package com.lancoo.cvas.mapper;

import com.lancoo.cvas.config.MybatisRedisCache;
import com.lancoo.cvas.entity.Segment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lancoo.cvas.pojo.vo.CourseTypeDto;
import org.apache.ibatis.annotations.CacheNamespace;

import java.util.List;

/**
 * 环节
 * 
 * @author liufeng
 * @email 1037383243@qq.com
 * @date 2023-12-04 11:54:00
 */
//@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class)
public interface SegmentMapper extends BaseMapper<Segment> {

    int addBatch(List<Segment> insertList);

    List<Segment> getNotIsEnableSegment(Integer taskId, String segmentTypeId, String keyWord);

    /**
     * 获取环节类别
     * @param taskId
     * @return
     */
    List<CourseTypeDto> getSegmentTypeByTaskId(Integer taskId);

    /**
     * 查询环节对应的基础平台id
     * @param taskId
     * @param deleted
     * @return
     */
    List<String> selectBaseSegmentIds(Integer taskId, Integer deleted);


    /**
     * 获取环节库，不使用缓存
     * @param taskId
     * @return
     */
    List<Segment> getSegmentList(Integer taskId);
}
